package com.hr.feign.email;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hr.entity.AoaInMailList;
import com.hr.entity.AoaMailnumber;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 *  邮箱业务Feign
 */
@FeignClient(value = "oa-core", contextId = "3")
public interface EmailFeignService {
    /**
     * 分页查询
     *
     * @param current 当前页码
     * @return List结果记录
     */
    @GetMapping("/aoaMailnumber/getMailInfo")
    public List queryByPage(Integer current);
    /**
     * 查询单条数据
     */
    @GetMapping("/aoaMailnumber/getMailOne")
    public AoaMailnumber getMailOne(Long id);

    /**
     * 提交修改数据
     * @return
     */
    @PostMapping("/aoaMailnumber/saveEdit")
    public void editCommit(@RequestBody @Validated String mailList);
    /**
     * 删除数据
     */
    @DeleteMapping("/deleteData")
    public ResponseEntity deleteData(String id);

    /**
     * 添加、保存数据
     * @param aoaMailnumber 邮箱表映射实体类
     * @return
     */
    @PostMapping("/saveaccount")
    public ResponseEntity saveData(AoaMailnumber aoaMailnumber);

    /**
     * 查询邮箱列表
     */
    @PostMapping("/queryMailList")
    public List<AoaInMailList> queryMailList();
    /**
     * 根据登入用户id查询内部邮箱消息
     * */
    @GetMapping("/queryMailList")
    public Page<AoaInMailList> getMailList(Integer current);

    /**
     * 標記已讀
     * @return
     */
    @PutMapping("/markRead")
    public ResponseEntity markRead(Integer[] arr);
}
